import _ from "lodash";
import "./style.css";
import Icon from "@/icon.png";
import Data from "./data.xml";
import Notes from "./data.csv";
import json from "./data.json5";
import db from "./db.json";

console.log("db", db);

console.log(json.title); // output `JSON5 Example`
console.log(json.owner.name); // output `Tom Preston-Werner`

function component() {
  const element = document.createElement("div");

  // lodash 现在使用 import 引入
  element.innerHTML = _.join(["Hello", "webpack"], " ");
  element.classList.add("hello");

  // 将图像添加到已经存在的 div 中。
  const myIcon = new Image();
  myIcon.src = Icon;

  element.appendChild(myIcon);

  console.log("xml", Data);
  console.log("csv", Notes);

  return element;
}

document.body.appendChild(component());
